package cn.kgc.tangcco.lifecycle;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 李昊哲
 * @Description
 * @create 2020/10/15 下午3:34
 */
@WebServlet(urlPatterns = "/lifeCycle01",loadOnStartup=10)
public class ServletLifeCycle01 extends HttpServlet {
    private static final long serialVersionUID = -2565569098231112594L;

    public ServletLifeCycle01() {
        System.out.println("lifeCycle01天之骄子");
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("lifeCycle01爱的轰轰烈烈");
    }

    @Override
    public void destroy() {
        System.out.println("lifeCycle01挥一挥衣袖不带走一片云彩");
    }

    @Override
    public void init() throws ServletException {
        System.out.println("lifeCycle01轻轻的我来了");
    }
}
